package main

import "fmt"

type UserInfo2 struct {
	Name string
	Age  int64
}

func main() {
	var userinfo = UserInfo2{Name: "zhangsan", Age: 10}

	var userIf interface{}

	userIf = userinfo

	//:= userIf.(UserInfo2)
	//if

	userTo, ok := (userIf).(UserInfo2)
	if ok {
		fmt.Println("id:" + userTo.Name)
	} else {
		fmt.Println("can not convert")
	}

	fmt.Printf("%v", userIf)
	fmt.Printf("%v", userTo.Name)
}
